@extends('layouts.userctl')
@section('content')
    <style>
        .layui-form-checkbox span {
            width: 100px
        }
    </style>
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto">
            <h2>工作人员【{{$user->name}}】分配职责</h2>
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="{{route('admin.user.assignUserrole2',['id'=>$user->id])}}" method="post">
                {{csrf_field()}}
                {{method_field('put')}}
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">角 色</label>
                    <div class="layui-input-block" style="width: 400px">
						<dl class="cate-box">
						    <dt>
						        <div class="cate-first">
						            <input type="checkbox" name="roles[]" value="1" title="安全员" lay-skin="primary" {{ in_array('1',$roles)?'checked':''}}>
								</div>
						    </dt>
						</dl>
						<dl class="cate-box">
						    <dt>
						        <div class="cate-first">
						            <input type="checkbox" name="roles[]" value="2" title="库管员" lay-skin="primary" {{ in_array('2',$roles)?'checked':''}}>
								</div>
						    </dt>
						</dl>
						<dl class="cate-box">
						    <dt>
						        <div class="cate-first">
						            <input type="checkbox" name="roles[]" value="3" title="考勤" lay-skin="primary" {{ in_array('3',$roles)?'checked':''}}>
								</div>
						    </dt>
						</dl>
                        
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formDemo">确 认</button>
                        <a class="layui-btn layui-btn-normal" href="{{route('admin.user.userlist')}}">返 回</a>
                    </div>
                </div>
            </form>
        </div>
    </div>

@endsection
